// src/store/modules/auth.store.ts
export default {
    state: () => ({
        token: localStorage.getItem('token') || '',
        userInfo: null as unknown
    }),

    actions: {
        setToken(token: string) {
            this.token = token
            localStorage.setItem('token', token)
        },

        logout() {
            this.token = ''
            this.userInfo = null
            localStorage.removeItem('token')
        }
    }
}